
package za.ac.cput.peterjohn.DesignPatternPrincipals.Behavioral.Mediator.Model;


public class Mediator 
{
    Buyer swedishBuyer;
    Buyer frenchBuyer;
    AmericanSeller americanSeller;
    DollarConverter dollarConverter;

    public Mediator() {}

    public boolean placeBid(float bid, String unitOfCurrency) 
    {
        float dollarAmount = dollarConverter.convertCurrencyToDollars(bid , unitOfCurrency);
        return americanSeller.isBidAccepted(dollarAmount);
    }

    public void registerAmericanSeller(AmericanSeller americanSeller) { this.americanSeller = americanSeller; }

    public void registerDollarConverter(DollarConverter dollarConverter) { this.dollarConverter = dollarConverter;}

    public void registerSwedishBuyer(SwedishBuyer swedishBuyer) { this.swedishBuyer = swedishBuyer; }

    public void registerFrenchBuyer(FrenchBuyer frenchBuyer) {this.frenchBuyer = frenchBuyer; }  
}